// 导入封装好的拦截器
import service from '../utils/request'

// 封装一个注册页请求接口
export function waimai_enroll(payload = {}) {
    return service.post('/api/user/register', payload)
}

// 封装一个登录页请求接口
export function waimai_login(payload = {}) {
    return service.post('/api/user/login', payload)
}

// 封装一个首页（店铺列表）请求接口
export function waimai_index(payload = {}) {
    return service.get('/api/shop/list', { params: payload })
}

// 封装一个爆爆团请求接口
export function waimai_tuan(payload = {}) {
    return service.get('/api/tuan/list', { params: payload })
}

// 封装一个轮播图页面请求接口
export function waimai_banner(payload = {}) {
    return service.get('/api/banner/list', { params: payload })
}

// 封装一个店铺搜素页请求接口
export function waimai_search(payload = {}) {
    return service.get('/api/shaop/search', { params: payload })
}

// 封装一个店铺详情页的请求接口
export function waimai_info(payload = {}) {
    return service.get('/api/shop/shopinfo', { params: payload })
}

// 封装一个店铺收藏列表的请求接口
export function waimai_favlist(payload = {}) {
    return service.get('/api/shop/favlist', { params: payload })
}

// 封装一个收藏店铺页请求接口
export function waimai_fav(payload = {}) {
    return service.post('/api/shop/fav', payload)
}

//封装一个取消收藏店铺请求接口
export function waimai_unfav(payload = {}) {
   return service.post('/api/shop/unfav', payload)
}

// 封装购物车列表页请求接口
export function waimai_cartlist(payload = {}) {
    return service.get('/api/shopcart/list', { params: payload })
}

// 封装清空购物车请求接口
export function waimai_cartclear(payload = {}) {
    return service.post('/api/shopcart/clear', payload)
}

// 封装一个购物车数量+1请求接口
export function waimai_cartadd(payload = {}) {
    return service.post('/api/shopcart/add', payload)
}

// 封装一个购物车数量-1请求接口
export function waimai_cartsub(payload = {}) {
    return service.post('/api/shopcart/sub', payload)
}

// 封装一个收获地址列表请求接口
export function wiamai_resslist(payload = {}) {
    return service.get('/api/address/list', { params: payload })
}

// 封装一个收货地址新增请求接口
export function waimai_ressadd(payload = {}) {
    return service.post('/api/address/add', payload)
}

// 封装一个收货地址删除请求接口
export function waimai_ressdel(payload = {}) {
    return service.post('/api/address/del', payload)
}

// 封装一个收货地址编辑请求接口
export function waimai_ressedit(payload = {}) {
    return service.post('/api/address/edit', payload)
}
